package com.iminutes.service;

import com.iminutes.dao.UserDao;
import com.iminutes.dao.impl.UserDaoImpl;
import com.iminutes.dao.impl.UserDaoImpl2;
import com.iminutes.factory.BeanFactory;
import com.iminutes.factory.UserFactory;

/**
 * @Description TODO
 * @Author liyuhua
 * @Date 2021/8/4 10:48
 **/
public class UserServiceImpl {
    //引入Dao
    UserDao ud = (UserDao) BeanFactory.createObjecct("UserDao");
    //保存
    public void save(){
        /*
        UserDao ud = new UserDaoImpl();
        ud.save();
         */
        //此时，出现紧耦合状况
//        UserDao ud = new UserDaoImpl2();
//        ud.save();

        //UserDao ud = UserFactory.getInstance();
        ud.save();
    }





}
